package com.beyondsoft.sabg.edu.utils;

import lombok.extern.slf4j.Slf4j;
import org.springframework.util.Base64Utils;
import org.springframework.web.multipart.MultipartFile;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;

/**
 * @Author Mo cr
 * @Date 2023/8/21
 */
@Slf4j
public class FileUtil {
    public static Long decodeFileId(String urlId) {
        Long id = null;
        try {
            String u = new String(Base64Utils.decodeFromString(urlId));
            id = Long.parseLong(u);
        } catch (Exception e) {
            log.error("file decode failed:{}", urlId);
        }
        return id;
    }

}
